
<html>
	<title>Google translation test</title>
<head>	
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg"
            type="text/javascript">
</script>
<script type="text/javascript" src="http://www.google.com/jsapi">
  
</script>

<script type="text/javascript">
     var map;
     var lTime = 0;
     var g_LangInit = false;

      google.load("language", "1");

    function loadMap() 
    {

      if (GBrowserIsCompatible()) 
      {
         map = new GMap2(document.getElementById("map"));
         map.setCenter(new GLatLng(22.7, 77.2), 5);
         //panToPlaceAndAddMarker(pLat,pLng,pPlaceName,pUserPhotoUrl)
        var center = new GLatLng(48.89364,  	2.33739);
        map.setCenter(center,5);
        
     }
    }


function
translateToArabia()
{
 var lAngliciaTxt = document.getElementById('anglicia').value;


 google.language.detect(lAngliciaTxt, function(result) {
        if (!result.error && result.language) {
          google.language.translate(lAngliciaTxt, result.language, "ar",
                                    function(result) {
            var translated = document.getElementById('arabia');
	    if (result.translation) {
	       alert(result.translation);
              translated.value = result.translation;
            }
          });
        }
      });
 
}

</script>

</head>
<body onload="loadMap()" onunload="GUnload()">

<table align=left bgclor="lightblue" cellspacing=2 cellpadding=2>
<tr><td> <div id="map" style="width: 600px; height: 300px"></div> </td><td colspan="*" width=200 height=200 bgcolor=brown></td></tr>
<tr><td align=center bgcolor=lightblue colspan="5"><font size=2><b>Compose Message</b></font></td></tr>
<tr><td><font size=2>English:</font></td></td></tr>
<tr><td>
<textarea id="anglicia" rows="2" cols="50">
At you will find all the Web-building tutorials you need, from basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea>
</tr>
<tr><td><font size=2>Arabic:</font></td></tr>
<tr><td>
<textarea id="arabia" rows="2" cols="50">
</textarea>
</td></tr>

<tr><td colspan=2 ><input type=button value="Translate to Arabic" onClick="translateToArabia()">
</td></tr>
</table>

</body>

</html>


